/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package CareerService.Entitybeans;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Administrator
 */
@Entity
@Table(name = "jobs")
@NamedQueries({@NamedQuery(name = "Jobs.findAll", query = "SELECT j FROM Jobs j"), @NamedQuery(name = "Jobs.findByJobnum", query = "SELECT j FROM Jobs j WHERE j.jobnum = :jobnum"), @NamedQuery(name = "Jobs.findByJobname", query = "SELECT j FROM Jobs j WHERE j.jobname = :jobname"), @NamedQuery(name = "Jobs.findByLocation", query = "SELECT j FROM Jobs j WHERE j.location = :location")})
public class Jobs implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "jobnum")
    private Integer jobnum;
    @Basic(optional = false)
    @Column(name = "jobname")
    private String jobname;
    @Column(name = "location")
    private String location;
    @Lob
    @Column(name = "description")
    private String description;
    @JoinColumn(name = "emnum", referencedColumnName = "emnum")
    @ManyToOne(optional = false)
    private Employer emnum;
    @JoinColumn(name = "country", referencedColumnName = "country_id")
    @ManyToOne
    private Countries country;
    @JoinColumn(name = "jobtype", referencedColumnName = "type_id")
    @ManyToOne
    private JobType jobtype;
    @JoinColumn(name = "town", referencedColumnName = "town_id")
    @ManyToOne
    private Towns town;

    public Jobs() {
    }

    public Jobs(Integer jobnum) {
        this.jobnum = jobnum;
    }

    public Jobs(Integer jobnum, String jobname) {
        this.jobnum = jobnum;
        this.jobname = jobname;
    }

    public Integer getJobnum() {
        return jobnum;
    }

    public void setJobnum(Integer jobnum) {
        this.jobnum = jobnum;
    }

    public String getJobname() {
        return jobname;
    }

    public void setJobname(String jobname) {
        this.jobname = jobname;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Employer getEmnum() {
        return emnum;
    }

    public void setEmnum(Employer emnum) {
        this.emnum = emnum;
    }

    public Countries getCountry() {
        return country;
    }

    public void setCountry(Countries country) {
        this.country = country;
    }

    public JobType getJobtype() {
        return jobtype;
    }

    public void setJobtype(JobType jobtype) {
        this.jobtype = jobtype;
    }

    public Towns getTown() {
        return town;
    }

    public void setTown(Towns town) {
        this.town = town;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (jobnum != null ? jobnum.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Jobs)) {
            return false;
        }
        Jobs other = (Jobs) object;
        if ((this.jobnum == null && other.jobnum != null) || (this.jobnum != null && !this.jobnum.equals(other.jobnum))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "CareerService.Entitybeans.Jobs[jobnum=" + jobnum + "]";
    }

}
